import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'
import vue2Page from '../components/vue2Page'
import vue3Page from '../components/vue3Page'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'Home',
    component: Home
  },
  {
    path: '/vue2/*', // vue-router@4.x path的写法为：'/my-page/:page*'
    name: 'vue2',
    component: vue2Page
  },
  {
    path: '/vue3/*', // vue-router@4.x path的写法为：'/my-page/:page*'
    name: 'vue3',
    component: vue3Page
  }
]

const router = new VueRouter({
  mode: 'hash',
  routes
})

export default router
